package demo;

import java.util.function.Function;

/**
 * @description:
 * @author: GX
 * @time: 2025/10/29 10:40
 */
public class lambdaTest {
    public static void main(String[] args) {
        // 创建一个 Lambda 表达式，实现 Welcome 接口的 hello() 方法
        Function<String, String> function = s -> s + ", hello!";
        System.out.println(function.apply("高鑫"));
        Function<Integer, Integer> function1 = x -> x * x;
        System.out.println(function1.apply(2));
    }
}
@FunctionalInterface
interface Welcome {
    String hello(String name);

}
